from django.db import models

class Clazz(models.Model):
    cno = models.AutoField(primary_key=True)
    cname = models.CharField(max_length=100,verbose_name='班级:')
    def __str__(self):
        return u'Clazz:%s'%self.cname


class Student(models.Model):
    sno = models.AutoField(primary_key=True)
    sname = models.CharField(max_length=100,verbose_name='姓名:')
    # password = models.CharField(max_length=100)
    cla = models.ForeignKey(Clazz,on_delete=models.CASCADE)

    def __str__(self):
        return u'Student:%s'%self.sname